package com.lzy.controller;

import com.lzy.entity.Result;
import com.lzy.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 菜单权限表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-05-06
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private IMenuService menuService;

    /**
     * 根据角色获取菜单
     * @param role 角色ID
     * @return 菜单列表
     */
    @GetMapping("/list/{role}")
    public Result getMenusByRole(@PathVariable("role") Integer role) {
        return Result.success(menuService.getMenusByRole(role));
    }
} 